<template lang="html">
  <div class="all2">
    <div class="allUp2">
      <img :src="object.imageUrl" alt="">
      <div class="txt2">
        <span>{{ object.title }}</span>
        <span>{{ object.subTitle }}</span>
      </div>
      <span class="b2">全部路线 》</span>
    </div>
    <div class="hotArea2">
      <p>热门目的地</p>
      <ul class="hots2">
        <li v-for="i of hot">
          <imgtext :obj="i"></imgtext>
        </li>
      </ul>

    </div>
    <div class="area2" v-if="hotTitle!=''">
      <p>全部地区</p>
      <div class="tt2">
        <ul>
          <li v-for="i of hotTitle"><a href="javascript:void(0)">{{i.title}}</a></li>
        </ul>
      </div>
    </div>
    <div v-else>
      <p class="pShow2"></p>
    </div>
    <div>
      <p class="pShow2_2"></p>
    </div>
  </div>
</template>

<script>
import imgtext from "./imgText.vue"
export default {
  components:{
    imgtext
  },
  data(){
    return{
      object:{},
      hot:{},
      hotTitle:{},
      all:this.$route.params.all,
      modules:{},
      data:{}
    }
  },
  watch:{
    "$route"(newValue,oldValue){
      // console.log(oldValue);
      // console.log(newValue);
      this.all = newValue.params.all;
      console.log(this.all);
      this.object = this.modules[this.all];
      this.hot = this.object.hotdests;
      this.hotTitle = this.object.allRegions;
    }
  },
  created(){
    this.axios.get('http://txspring.cn:8080/getMu').then(data=>{
      this.modules = data.data.data.modules;
      this.datas = this.modules[this.$route.params.all];
      this.object = this.datas;
      this.hot = this.datas.hotdests;
      this.hotTitle = this.datas.allRegions;
      console.log(this.$route.params.all);
    })
  }
}
</script>

<style lang="css">
.all2{
  width: 85%;
  margin: 0 auto;
  /*margin-top: 0.4%;*/
  display: flex;
  flex-direction: column;
}
.allUp2{
  position: relative;
}
.allUp2>img{
  width: 100%;
  border-radius: 0.3rem;
}
.txt2{
  color: #fff;
  text-align: left;
  position: absolute;
  bottom: 0.4rem;
  left: 0.5rem;
}
.txt2>span{
  display: block;
}
.txt2>span:nth-of-type(1){
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}
.txt2>span:nth-of-type(2){
  font-size: 1.3rem;
}
.b2{
  font-size: 1.2rem;
  color: #fff;
  position: absolute;
  right: 0.5rem;
  bottom: 0.4rem;
}
.hotArea2>p,.area2>p{
  text-align: left;
  margin: 1rem 0;
}
.hots2>li{
  width: 48%;
  float: left;
  margin-top: 0.3rem;
}
.hots2>li:nth-of-type(2n+1){
  margin-right: 0.41rem;
}
.tt2 ul{
  /*display: flex;*/
}
.tt2>ul>li{
  float: left;
  width: 33%;
  height: 3.5rem;
  /*line-height: 3rem;*/
  padding-top: 1rem;
  border: 0.01rem solid #9993;
  background: #fff;
  text-align: center;
}
.area2 li:last-child{
  margin-bottom: 8rem;
}
.pShow2{
  height: 30rem;
  background: rgba(0,0,0,0);
}
.pShow2_2{
  height: 9rem;
  background: rgba(0,0,0,0);
}
</style>
